package com.gthncz.common;

import java.util.Properties;

import javax.sql.DataSource;

import org.apache.ibatis.datasource.DataSourceFactory;

/**
 * 自定义 DruidDataSource 数据源 整合Alibaba DataSource
 * @author GT
 *
 */
public class DruidDataSource extends com.alibaba.druid.pool.DruidDataSourceFactory implements DataSourceFactory {
	
	protected Properties props;

	@Override
	public void setProperties(Properties props) {
		this.props = props;
	}

	@Override
	public DataSource getDataSource() {
		try {
			DataSource dataSource = createDataSource(props);
			return dataSource;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
	
	

}
